package com.hustbaidu.hustmapplacepro2;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.TextView;

public class CommentAddActivity extends Activity {
	private ListView listView;	

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		setContentView(R.layout.comment_add);
		
		listView = (ListView)findViewById(R.id.commentlist);
		SimpleAdapter adapter = new SimpleAdapter(this, getData(), R.layout.comment_detail_layout, 
				new String[]{"comment_text","comment_person","comment_time"}, 
				new int[]{R.id.comment_text,R.id.comment_person,R.id.comment_time});
		listView.setAdapter(adapter);
				
	}
	private List<Map<String, Object>> getData(){
		List<Map<String, Object>> list = new ArrayList<Map<String,Object>>();
		Map<String, Object> map = null;
		
		
			map = new HashMap<String, Object>();
			map.put("comment_text", "我不记得要上ERP来着，拿错课本了");
			map.put("comment_person", "来自" + "Mary Peter");
			map.put("comment_time", "12-09-08 21:02");
			list.add(map);
			map = new HashMap<String, Object>();
			map.put("comment_text", "最喜欢那些在我什么都没干的时候来我人人的人~");
			map.put("comment_person", "来自" + "苏妲己");
			map.put("comment_time", "12-09-28 11:22");
			
			list.add(map);
			map = new HashMap<String, Object>();
			map.put("comment_text", "白羊座《恋爱ing》；狮子座《倔强》；天蝎座《突然好想你》；魔羯 座《第二人生》；水瓶座《你不是真正的快乐》；双鱼座《为爱而生》");
			map.put("comment_person", "来自" + "教你做个K歌高手");
			map.put("comment_time", "12-09-08 21:02");
			list.add(map);
			map = new HashMap<String, Object>();
			map.put("comment_text", "又回到武汉了，汉口火车站变的干净美观不少。");
			map.put("comment_person", "来自" + "万佩");
			map.put("comment_time", "12-09-08 23:02");
			list.add(map);
			map = new HashMap<String, Object>();
			map.put("comment_text", "独在异乡为异客 ，每逢佳节。。。胖。。。三。。。斤！！！");
			map.put("comment_person", "来自" + "曾小贤 ");
			map.put("comment_time", "12-09-12 14:02");
			list.add(map);
			map = new HashMap<String, Object>();
			map.put("comment_text", "母校，生快~~");
			map.put("comment_person", "来自" + "小胡");
			map.put("comment_time", "12-09-08 21:02");
			list.add(map);
			map = new HashMap<String, Object>();
			map.put("comment_text", "同学在学生会吧 过节请客吃饭是他们固有程序 学生会越来越廉价了 15块钱打发了");
			map.put("comment_person", "来自" + "李宏模 ");
			map.put("comment_time", "12-09-08 21:02");
			list.add(map);
			map = new HashMap<String, Object>();
			map.put("comment_text", "大学四年顶个球");
			map.put("comment_person", "来自" + "许梦逸");
			map.put("comment_time", "12-10-08 21:02");
			list.add(map);
		return list;
	}
	
}